package com.deer.remote.server.app;

import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;

import com.deer.remote.common.util.Configs;
import com.deer.remote.common.util.Log;
import com.deer.remote.server.rds.TentacleDesktopSession;

/**
 * Created by matrixy on 2019/1/3.
 */
public final class RemoteDesktopApp {
	public static void init() throws Exception {
		ServerSocket server = new ServerSocket(Configs.getInt("rds.server.port", 1986), 100,
				InetAddress.getByName("0.0.0.0"));
		while (true) {
			Socket conn = server.accept();
			Log.debug(String.format("Tentacle Desktop Connected from: %s", conn.getInetAddress().toString()));
			TentacleDesktopSession session = new TentacleDesktopSession(conn);
			session.start();
		}
	}
}
